package com.paitoubing.springboot.service;

import com.paitoubing.springboot.bean.Users;
import com.paitoubing.springboot.dao.UsersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UsersService {

    @Autowired
    private UsersMapper usersDao;

    public int add(Users users){
        return usersDao.addUser(users);
    }

    public Users get(Long id){
        return usersDao.findById(id);
    }

    public List<Users> list(){
        return usersDao.findAll();
    }
}
